package com.anyou.mall.goo.specs.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.anyou.common.annotation.Log;
import com.anyou.common.core.controller.BaseController;
import com.anyou.common.core.domain.ApiResult;
import com.anyou.common.enums.BusinessType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.anyou.mall.goo.specs.domain.SpeSpecsValue;
import com.anyou.mall.goo.specs.service.ISpeSpecsValueService;
import com.anyou.common.utils.poi.ExcelUtil;
import com.anyou.common.core.page.TableDataInfo;

/**
 * 规格值Controller
 *
 * @author xq
 * @date 2022-03-28
 */
@Api(tags = "规格值")
@RestController
@RequestMapping("/specsList/specsValue")
public class SpeSpecsValueController extends BaseController
{
    @Autowired
    private ISpeSpecsValueService speSpecsValueService;

   /* *//**
     * 查询规格值列表
     *//*
    @ApiOperation("查询规格值列表")
    @PreAuthorize("@ss.hasPermi('specsList:specsValue:list')")
    @GetMapping("/list")
    public TableDataInfo<List<SpeSpecsValue>> list(SpeSpecsValue speSpecsValue)
    {
        startPage();
        List<SpeSpecsValue> list = speSpecsValueService.selectSpeSpecsValueList(speSpecsValue);
        return getDataTable(list);
    }

    *//**
     * 导出规格值列表
     *//*
    @ApiOperation("导出规格值列表")
    @PreAuthorize("@ss.hasPermi('specsList:specsValue:export')")
    @Log(title = "规格值", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, SpeSpecsValue speSpecsValue)
    {
        List<SpeSpecsValue> list = speSpecsValueService.selectSpeSpecsValueList(speSpecsValue);
        ExcelUtil<SpeSpecsValue> util = new ExcelUtil<SpeSpecsValue>(SpeSpecsValue.class);
        util.exportExcel(response, list, "规格值数据");
    }

    *//**
     * 获取规格值详细信息
     *//*
    @ApiOperation("获取规格值详细信息")
    @PreAuthorize("@ss.hasPermi('specsList:specsValue:query')")
    @GetMapping(value = "/{specsValueId}")
    public ApiResult<SpeSpecsValue> getInfo(@PathVariable("specsValueId") Long specsValueId)
    {
        return ApiResult.success(speSpecsValueService.selectSpeSpecsValueBySpecsValueId(specsValueId));
    }

    *//**
     * 新增规格值
     *//*
    @ApiOperation("新增规格值")
    @PreAuthorize("@ss.hasPermi('specsList:specsValue:add')")
    @Log(title = "规格值", businessType = BusinessType.INSERT)
    @PostMapping
    public ApiResult add(@RequestBody SpeSpecsValue speSpecsValue)
    {
        return ApiResult.success(speSpecsValueService.insertSpeSpecsValue(speSpecsValue));
    }

    *//**
     * 修改规格值
     *//*
    @ApiOperation("修改规格值")
    @PreAuthorize("@ss.hasPermi('specsList:specsValue:edit')")
    @Log(title = "规格值", businessType = BusinessType.UPDATE)
    @PutMapping
    public ApiResult edit(@RequestBody SpeSpecsValue speSpecsValue)
    {
        return ApiResult.success(speSpecsValueService.updateSpeSpecsValue(speSpecsValue));
    }

    *//**
     * 删除规格值
     *//*
    @ApiOperation("删除规格值")
    @PreAuthorize("@ss.hasPermi('specsList:specsValue:remove')")
    @Log(title = "规格值", businessType = BusinessType.DELETE)
    @DeleteMapping("/{specsValueIds}")
    public ApiResult remove(@PathVariable Long[] specsValueIds)
    {
        return ApiResult.success(speSpecsValueService.deleteSpeSpecsValueBySpecsValueIds(specsValueIds));
    }*/
}
